package com.fsp.blog.controller;

import com.fsp.blog.service.TagsService;
import com.fsp.blog.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author fushengping
 * @className TagsController
 * @description
 * @date 2021/11/7 17:20
 */
@RestController
@RequestMapping("/tags")
public class TagsController {

    @Autowired
    private TagsService tagsService;

    @GetMapping("/hot") //查询最热标签
    public Result listHotTags() {
        int limit = 6;
        return tagsService.listHotTags(limit);
    }

    @GetMapping   //查询所有标签类别
    public Result findAll(){
        return tagsService.findAll();
    }

    @GetMapping("/detail") //导航-标签详情
    public Result findAllDetail(){
        return tagsService.findAllDetail();
    }

    @GetMapping("/detail/{id}") //文章列表分类
    public Result findDetailById(@PathVariable("id") Long id){
        return tagsService.findDetailById(id);
    }
}
